home *** CD-ROM | disk | FTP | other *** search
- Path: news.crd.ge.com!rebecca!rpi!not-for-mail
- From: vm@panix.com (Victor Muslin)
- Newsgroups: comp.lang.c++,comp.lang.c++.moderated
- Subject: Help with IOStreams needed!
- Date: 16 Apr 1996 00:25:12 -0000
- Organization: Access Net Direct
- Sender: cppmods@netlab.cs.rpi.edu
- Approved: herbs@connobj.com
- Message-ID: <4kupd8$khj@netlab.cs.rpi.edu>
- NNTP-Posting-Host: netlab.cs.rpi.edu
- X-Original-Date: 14 Apr 1996 19:33:18 GMT
-
- I am new to IOStreams, so please pardon if this is a silly question...
-
- I open a file as an ofstream. When I write to it I would like to lock it to
- ensure that no other process can write until I am done. In C I could've used
- an flock() to which I would pass a file descriptor obtained from open(). How
- do I do I find the file descriptor associated with an ofstream (or ostream for
- that matter)? Or, is there a better way to lock an output stream in C++?
-
- If you could copy your reply to vmuslin@prodigy.com I would appreciate it.
-
- {Those who post questions to a newsgroup are expected to read the
- newsgroup for the reply. See the netnews netiquette guide. -mod}
-
- Thanks.
-
-
- [ Articles to moderate: mailto:c++-submit@netlab.cs.rpi.edu ]
- [ Read the C++ FAQ: http://www.connobj.com/cpp/cppfaq.htm ]
- [ Moderation policy: http://www.connobj.com/cpp/guide.htm ]
- [ Comments? mailto:c++-request@netlab.cs.rpi.edu ]
-